/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-10     Administrator       the first version
 */
#ifndef APPLICATIONS_SPI_SH1106_OLED_SH1106_H_
#define APPLICATIONS_SPI_SH1106_OLED_SH1106_H_

#ifndef __OLED_SH1106_H
#define __OLED_SH1106_H

#include <rtthread.h>
#include "board.h"

//SCL=PE3
//SDA=PE2
//DC=PA0
//CS=PA2
//FS0=MOSI
//CS2=CS2


#define OLED_CMD  0 //写命令
#define OLED_DATA 1 //写数据

void OLED_ColorTurn(uint8_t i);
void OLED_DisplayTurn(uint8_t i);
void OLED_WR_Byte(uint8_t dat,uint8_t cmd);
void OLED_Clear(void);
void OLED_address(uint8_t x,uint8_t y);
void OLED_Display_128x64(uint8_t *dp);
void OLED_Display_16x16(uint8_t x,uint8_t y,uint8_t *dp);
void OLED_Display_8x16(uint8_t x,uint8_t y,uint8_t *dp);
void OLED_Display_5x7(uint8_t x,uint8_t y,uint8_t *dp);
void Send_Command_to_ROM(uint8_t dat);
uint8_t  Get_data_from_ROM(void);
void OLED_get_data_from_ROM(uint8_t addrHigh,uint8_t addrMid,uint8_t addrLow,uint8_t *pbuff,uint8_t DataLen);
void OLED_Display_GB2312_string(uint8_t x,uint8_t y,uint8_t *text);
void OLED_Display_string_5x7(uint8_t x,uint8_t y,uint8_t *text);
void OLED_ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t size);
void OLED_Init(void);

#endif



#endif /* APPLICATIONS_SPI_SH1106_OLED_SH1106_H_ */
